﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using MinimalistFoodStreet.BackEnd.Infrastructure.Attributes;
using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;
using MinimalistFoodStreet.BackEnd.Server.IServer;
using MinimalistFoodStreet.BackEnd.Server.Server.Tables;
using MinimalistFoodStreet.BackEnd.Server.TableEFCore;

namespace MinimalistFoodStreet.BackEnd.Server.Server
{
        [InjectClass]
    public class LogServer : ILogServer
    {
        private readonly ServerRepository _serverRepository;

        public LogServer(DbContext dbContext)
        {
            _serverRepository = new ServerRepository(dbContext);
        }
        public int AddActionLog(ActionLog log)
        {
           return _serverRepository.actionLogsEFCore.Add(log);
        }

        public int AddErrorLog(ErrorLog log)
        {
            return _serverRepository.errorLogsEFCore.Add(log);
        }

        public int AddLoginLog(LoginLog log)
        {
            return _serverRepository.loginLogsEFCore.Add(log);
        }
    }
}
